﻿<!doctype html>
<html class="no-js " lang="en">
<head>
<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta name="description" content="Responsive Bootstrap 4 and web Application ui kit.">

    <title>用户登录</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/main.css">
    <link rel="stylesheet" href="assets/css/authentication.css">
    <link rel="stylesheet" href="assets/css/color_skins.css">
</head>

<body class="theme-purple authentication sidebar-collapse">
<!-- End Navbar -->
<div class="page-header">
    <div class="container">
        <div class="col-md-12 content-center">
            <div class="card-plain">
                <form class="form" method="" action="">
                    <div class="header">
                        <div class="logo-container">
                            <img src="assets/images/logo.svg" alt="">
                        </div>
                        <h5>用户登录</h5>
                    </div>
                    <div class="content">                                                
                        <div class="input-group input-lg">
                            <input type="text" class="form-control user_Name" placeholder="请输入用户名">
                            <span class="input-group-addon">
                                <i class="zmdi zmdi-account-circle"></i>
                            </span>
                        </div>
                        <div class="input-group input-lg">
                            <input type="password" placeholder="请输入密码" class="form-control key_Word" />
                            <span class="input-group-addon">
                                <i class="zmdi zmdi-lock"></i>
                            </span>
                        </div>
                    </div>
                    <div class="footer text-center">
                        <a href="#" class="btn btn-primary btn-round btn-lg btn-block login_Btn ">登录</a>
                      <!--  <p>未注册会员账号？请 <a class="" href="sign-up.html">注册</a></p>-->
                    </div>
                </form>
            </div>
        </div>
    </div>

</div>

<!-- Jquery Core Js -->
<script src="assets/bundles/libscripts.bundle.js"></script>
<script src="assets/bundles/vendorscripts.bundle.js"></script> <!-- Lib Scripts Plugin Js -->
<script src="assets/js/pages/ui/notifications.js"></script> <!-- Custom Js -->
<script>
   $(".navbar-toggler").on('click',function() {
    $("html").toggleClass("nav-open");
});
//=============================================================================
$('.form-control').on("focus", function() {
    $(this).parent('.input-group').addClass("input-group-focus");
}).on("blur", function() {
    $(this).parent(".input-group").removeClass("input-group-focus");
});
$(function () {
	   // var prefix = window.parent.document.location.href;


	    $(".login_Btn").click(function () {
	       //debugger;
	        var  userName = $(".user_Name").val();
	        var keyWord = $(".key_Word").val();
	        //var prefix = location.hostname+"/"+location.port+"";
	        var data1 = {userName: userName, password: keyWord};
	        var datas = JSON.stringify(data1)
	        debugger;
	        $.ajax({
	            type: "post",
	            url: "/user/doLogin",
	            data: datas,
	            contentType: "application/json;charset=utf-8", //这个是发送信息至服务器时内容编码类型
	            dataType: "json",
	            success: function (data) {
	                console.log(JSON.stringify(data))
	                if (data.statue == true) {
	                    window.location.href = "/userGuarantee/user"
	                } else {
	                    alert(data.msg)
	                }

	            }
	        })
	    })

	});
</script>
</body>
</html>